<script>
   DEG_TRANNING = <?php _e(json_encode($this->get('skills_sp')));?>;
   SALARY_PARAMS = <?php _e(json_encode($this->get('salary_params')));?>;
   CONTRACT_TYPES = <?php _e(json_encode($this->get('contract_type')));?>;
   <?php $st = $this->get('setting');?>
   BASIC_SALARY	= <?php _e($st['basic_salary']);?>
</script>

<?php $post = $this->get('general'); ?>
<div class="x-list-title">
   <table width="100%" border="0" height="100%">
      <tr>
         <td align="left">
            <h2>Chỉnh sửa nhân sự <?php _e($post['name']);?>
            </h2>
         </td>
         <td align="right">
            <div class="x-list-options">

            </div>
         </td>
      </tr>
   </table>
</div>
<form  method="post" action="<?php _e(actionUrl($this)) ?>" onsubmit="return ajax_form(this)">
   <input type="hidden" name="ID" value="<?php _e(get('ID')) ?>"/>
   <div class="tab-container" style="overflow: true;margin-top:-2px">
      <div class="tab-bar" style="border-right:1px solid #ccc">
         <a class="tab-link tab-link-first tab-link-active" onclick="do_tab(this,1)">Thông tin chung</a>
         <a class="tab-link" onclick="do_tab(this,2)">Sơ yếu lý lịch</a>
         <a class="tab-link" onclick="do_tab(this,3)">Quá trình lương</a>
         <a class="tab-link" onclick="do_tab(this,4)">Quá trình đào tạo</a>
         <a class="tab-link" onclick="do_tab(this,5)">Quá trình công tác</a>
         <a class="tab-link" onclick="do_tab(this,6)">Quản lý Đảng</a>
         <a class="tab-link" onclick="do_tab(this,8)">Hợp đồng</a>
         <a class="tab-link" onclick="do_tab(this,7)">File hồ sơ</a>
         <span class="clear"></span>
      </div>
      <div class="form-message"></div>
      <div class="tabs">
            <div class="tab tab-active" >
            <table style="border: 1px solid #CBCBCD;" width="100%" cellpadding="4" class="x-form">
               <tr>
                  <td width="15%" align="right" ><b>Số hiệu </b></td>
                  <td width="30%">
                     <input class="x-text" type="text" style="width: 292px;" name="code"  value="<?php _e($post["code"]); ?>"/>
                  </td>
                  <td width="15%" align="right"><b>Vị trí hồ sơ</b></td>
                  <td width="40%">
                     <input class="x-text" value="<?php _e($post["position"]); ?>" type="text" name="position" style="width: 146px;"  />
                  </td>
               </tr>
               <tr>
                  <td align="right" ><b>Họ tên</b></td>
                  <td>
                      <input class="x-text" onkeyup="per_uptext(this)" type="text" name="name" style="width: 292px;"  value="<?php _e($post["name"]); ?>"/>
                  </td>
                  <td align="right" ><b>Tên gọi khác ( nếu có )</b></td>
                  <td>
                     <input class="x-text" type="text" name="othername" style="width: 292px;"   value="<?php _e($post["othername"]); ?>"/>
                  </td>
               </tr>
               <tr>
                  <td align="right"><b>Ngày sinh</b></td>
                  <td>
                     <input  class="x-text x-date" onclick="date_picker(this,{format: 'd/m/Y' })" type="text" name="birthday"  value="<?php _e(show_date(DATE_FORMAT,$post["birthday"])); ?>"/>
                     <span style="margin-left: 20px;"><i> ( dd / mm / yyyy )</i></span>
                  </td>

                  <td align="right" ><b>Giới tính</b></td>
                  <td >
                     <input type="radio" name="gender" value="0"<?php if($post['gender']=='0') _e(' checked');?>/>Nam
                     <input type="radio" name="gender" value="1"<?php if($post['gender']=='1') _e(' checked');?>/>Nữ
                  </td>
               </tr>

               <tr>
                  <td align="right"><b>Phòng ban</b></td>
                  <td>
                    <select name="department_id" class="x-select" style="width:258px">
                        <?php _e( select_options($this->get('departments'),'title',$post['department_id']) );?>
                    </select>
                  </td>
                  <td align="right"><b>Chức vụ</b></td>
                  <td>
                     <input class="x-text" type="text" name="functions" style="width: 292px;"  value="<?php _e($post["functions"]); ?>"/>
                  </td>
               </tr>
               <tr>
                  <td align="right"><b>Email</b></td>
                  <td>
                     <input  class="x-text" type="text" style="width: 292px;" name="email"  value="<?php _e($post["email"]); ?>"/>

                  </td>
                  <td align="right"><b>Điện thoại</b></td>
                  <td>
                     <input class="x-text" style="width: 292px;" type="text" name="phone"  value="<?php _e($post["phone"]); ?>"/>
                  </td>

               </tr>
               <tr>
                  <td align="right" valign="top"><b>Ảnh cá nhân</b></td>
                  <td colspan="3">
					 <img src="<?php _baseUrl()?>/files/<?php if(!$post['photo']):?>photo/noavatar.gif<?php else:?>/personnel/<?php _e($post['photo']);?><?php endif;?>" style="height:160px;width:120px" class="personnel-photo"/>
					 <div class="x-file" filetypes="*.jpg;*.gif;*.png;*.jpeg" filename="photo" url="<?php _baseUrl(); ?>/Personnel/Index/Photo?ID=<?php _e(get('ID'));?>">Tải ảnh lên</div>
                  </td>
               </tr>
            </table>
         </div>
         <?php $cvs = $this->get('cvs'); ?>
          <div class="tab">
            <div>
               <table style="border: 1px solid #CBCBCD;" width="100%" cellpadding="4" class="x-form">

                  <tr>
                     <td width="15%" align="right" ><b>Nơi sinh</b></td>
                     <td width="30%">
                        <input class="x-text" type="text" style="width: 292px;" name="born_in"  value="<?php _e($cvs["born_in"]); ?>"/>
                     </td>
                     <td width="15%" align="right"><b>Quê quán</b></td>
                     <td width="40%">
                        <input class="x-text" type="text" name="native_country" value="<?php _e($cvs["native_country"]); ?>" style="width: 292px;"/>
                     </td>
                  </tr>
                  <tr>
                     <td align="right" ><b>Dân tộc</b></td>
                     <td>
                        <input class="x-text" type="text" name="nation" style="width: 292px;"  value="<?php _e($cvs["nation"]); ?>"/>
                     </td>
                     <td align="right" ><b>Tôn giáo</b></td>
                     <td>
                        <input class="x-text" type="text" name="religion" style="width: 292px;"   value="<?php _e($cvs["religion"]); ?>"/>
                     </td>

                  </tr>
                  <tr>
                     <td align="right"><b>Nơi đăng ký hộ khẩu</b></td>
                     <td>
                        <input class="x-text" type="text" name="inhabitant" style="width: 292px;"   value="<?php _e($cvs["inhabitant"]); ?>"/>
                     </td>

                     <td align="right" ><b>Nơi ở hiện tại</b></td>
                     <td >
                        <input class="x-text" type="text" name="residence" style="width: 292px;"   value="<?php _e($cvs["residence"]); ?>"/>
                     </td>
                  </tr>


                  <tr>
                     <td align="right"><b>Ngày tuyển dụng</b></td>
                     <td>
                        <input  class="x-text x-date" onclick="date_picker(this,{format: 'd/m/Y' })" type="text" name="date_recruit"  value="<?php _e(show_date(DATE_FORMAT,$cvs["date_recruit"])); ?>"/>
                        <span style="margin-left: 20px;"><i> ( dd / mm / yyyy )</i></span>

                     </td>
                     <td align="right"><b>Cơ quan tuyển dụng</b></td>
                     <td>
                        <input class="x-text" style="width: 292px;" type="text" name="unit_recruit"  value="<?php _e($cvs["unit_recruit"]); ?>"/>
                     </td>

                  </tr>
                  <tr>
                     <td align="right"><b>Công việc chính</b></td>
                     <td>
                        <input  class="x-text" type="text" style="width: 292px;" name="main_type_job"  value="<?php _e($cvs["main_type_job"]); ?>"/>

                     </td>
                     <td align="right"><b>Sở trương công tác</b></td>
                     <td>
                        <input class="x-text" style="width: 292px;" type="text" name="main_active"  value="<?php _e($cvs["main_active"]); ?>"/>
                     </td>

                  </tr>
                  <tr>
                     <td align="right"><b>Trình độ phổ thông</b></td>
                     <td>
                        <input  class="x-text" type="text" style="width: 292px;" name="skill_common"  value="<?php _e($cvs["skill_common"]); ?>"/>

                     </td>
                     <td align="right"><b>Trình độ chuyên môn </b></td>
                     <td>
                        <select class="x-select" name="skill_speciality_id">
                            <option value=""></option>
							<?php _e( select_options($this->get('skills_sp'),'title',$cvs['skill_speciality_id']) );?>
                        </select>
                     </td>
                  </tr>

                  <tr>
                     <td align="right"><b>Lý luận chính trị</b></td>
                     <td>
                        <select class="x-select" name="argue_politics">
                           <option value=""></option>
                           <option value="Cử nhân"<?php if($cvs['argue_politics'] =='Cử nhân') _e(' selected')?>>Cử nhân</option>
                           <option value="Cao cấp"<?php if($cvs['argue_politics'] =='Cao cấp') _e(' selected')?>>Cao cấp</option>
                           <option value="Trung cấp"<?php if($cvs['argue_politics'] =='Trung cấp') _e(' selected')?>>Trung cấp </option>
                           <option value="Sơ cấp"<?php if($cvs['argue_politics'] =='Sơ cấp') _e(' selected')?>>Sơ cấp</option>
                        </select>
                     </td>
                     <td align="right"><b>Quản lý nhà nước</b></td>
                     <td>
                        <select class="x-select" name="skill_manage">
                           <option value=""></option>
                           <option value="Chuyên viên cao cấp"<?php if($cvs['skill_manage'] =='Chuyên viên cao cấp') _e(' selected')?>>Chuyên viên cao cấp</option>
                           <option value="Chuyên viên chính"<?php if($cvs['skill_manage'] =='Chuyên viên chính') _e(' selected')?>>Chuyên viên chính</option>
                           <option value="Chuyên viên"<?php if($cvs['skill_manage'] =='Chuyên viên') _e(' selected')?>>Chuyên viên</option>
                           <option value="Cán sự"<?php if($cvs['skill_manage'] =='Cán sự') _e(' selected')?>>Cán sự</option>
                        </select>
                     </td>

                  </tr>
                  <tr>
                     <td align="right"><b>Trình độ ngoại ngữ</b></td>
                     <td>
                        <input  class="x-text" type="text" style="width: 242px;" name="skill_lang"  value="<?php _e($cvs["skill_lang"]); ?>"/>
                        <select class="x-select" name="skill_lang_lv">
                           <option value=""></option>
                           <option value="A"<?php if($cvs['skill_lang_lv'] =='A') _e(' selected')?>>A</option>
                           <option value="B"<?php if($cvs['skill_lang_lv'] =='B') _e(' selected')?>>B</option>
                           <option value="C"<?php if($cvs['skill_lang_lv'] =='C') _e(' selected')?>>C</option>
                        </select>
                     </td>
                     <td align="right"><b>Trình độ tin học </b></td>
                     <td>
                        <input  class="x-text" type="text" style="width: 242px;" name="skill_info"  value="<?php _e($cvs["skill_info"]); ?>"/>
                        <select class="x-select" name="skill_info_lv">
                           <option value=""></option>
                           <option value="A"<?php if($cvs['skill_info_lv'] =='A') _e(' selected')?>>A</option>
                           <option value="B"<?php if($cvs['skill_info_lv'] =='B') _e(' selected')?>>B</option>
                           <option value="C"<?php if($cvs['skill_info_lv'] =='C') _e(' selected')?>>C</option>
                        </select>
                     </td>
                  </tr>
                  <tr>
                     <td align="right"><b>Ngày nhập ngũ</b></td>
                     <td>
                        <input  class="x-text x-date" type="text" onclick="date_picker(this,{format: 'd/m/Y' })"  name="date_join_army"  value="<?php _e(show_date(DATE_FORMAT,$cvs["date_join_army"])); ?>"/>
                        <span style="margin-left: 22px; "><b>Ngày xuất ngũ</b></span>
                        <input  class="x-text x-date" type="text" onclick="date_picker(this,{format: 'd/m/Y' })"  name="date_out_army"  value="<?php _e(show_date(DATE_FORMAT,$cvs["date_out_army"])); ?>"/>
                     </td>
                     <td align="right"><b>Quân hàm cao nhất</b></td>
                     <td>
                        <input class="x-text" style="width: 292px;" type="text" name="army_rank"  value="<?php _e($cvs["army_rank"]); ?>"/>
                     </td>
                  </tr>
                  <tr>
                     <td align="right"><b>Danh hiệu  phong tặng</b></td>
                     <td>
                        <input class="x-text" style="width: 292px;" type="text" name="identifier"  value="<?php _e($cvs["identifier"]); ?>"/>
                     </td>
                     <td align="right"><b>Ngày tham gia tổ chức XH</b></td>
                     <td>
                        <input class="x-text x-date" onclick="date_picker(this,{format: 'd/m/Y' })" type="text" name="date_join_institute"  value="<?php _e(show_date(DATE_FORMAT,$cvs["date_join_institute"])); ?>"/>
                        <span style="margin-left: 20px;"><i> ( dd / mm / yyyy )</i></span>
                     </td>

                  </tr>
                  <tr>
                     <td align="right"><b>Khen thưởng</b></td>
                     <td>
                        <input class="x-text" style="width: 292px;" type="text" name="reward"  value="<?php _e($cvs["reward"]); ?>"/>
                     </td>
                     <td align="right"><b>Kỷ luật</b></td>
                     <td>
                        <input class="x-text" style="width: 292px;" type="text" name="discipline"  value="<?php _e($cvs["discipline"]); ?>"/>
                     </td>
                  </tr>
                  <tr>
                     <td align="right"><b>Tình trạng sức khỏe</b></td>
                     <td>
                        <input class="x-text" style="width: 292px;" type="text" name="status"  value="<?php _e($cvs["status"]); ?>"/>
                     </td>
                     <td align="right"><b>Chiều cao</b></td>
                     <td>
                        <input class="x-text" style="width: 60px;" type="text" name="tall"  value="<?php _e($cvs["tall"]); ?>"/>
                        <span><b>Cân nặng </b></span>
                        <input class="x-text" style="width: 48px;" type="text" name="weight"  value="<?php _e($cvs["weight"]); ?>"/>
                        <span><b>Nhóm máu </b></span>
                        <select name="blood_group" class="x-select">
                            <option value=""></option>
                           <option value="A"<?php if($cvs['blood_group'] =='A') _e(' selected')?>>A</option>
                           <option value="AB"<?php if($cvs['blood_group'] =='AB') _e(' selected')?>>AB</option>
                           <option value="B"<?php if($cvs['blood_group'] =='B') _e(' selected')?>>B</option>
                           <option value="O"<?php if($cvs['blood_group'] =='O') _e(' selected')?>>O</option>

                        </select>
                     </td>
                  </tr>

                  <tr>
                     <td align="right"><b>Là thương binh hạng</b></td>
                     <td>
                        <input class="x-text" style="width: 292px;" type="text" name="injury"  value="<?php _e($cvs["injury"]); ?>"/>
                     </td>
                     <td align="right"><b>Là con gia đình chính sách</b></td>
                     <td>
                        <input class="x-text" style="width: 292px;" type="text" name="injury_policy"  value="<?php _e($cvs["injury_policy"]); ?>"/>
                     </td>
                  </tr>
                  <tr>
                     <td align="right"><b>Chứng minh thư nhân dân</b></td>
                     <td>
                        <input class="x-text" style="width: 190px;" type="text" name="identity_card"  value="<?php _e($cvs["identity_card"]); ?>"/>
                        <input class="x-text x-date" onclick="date_picker(this,{format: 'd/m/Y' })" type="text" name="date_iden_sub"  value="<?php _e($post["date_iden_sub"]); ?>"/>
                     </td>
                     <td align="right"><b>Sổ bảo hiểm XH</b></td>
                     <td>
                        <input class="x-text" style="width: 292px;" type="text" name="safety_number"  value="<?php _e($cvs["safety_number"]); ?>"/>
                     </td>
                  </tr>
               </table>
            </div>
         </div>
         <?php $salary = $this->get('salary'); ?>
         <div class="tab" >
            <table  cellpadding="4" width="100%" class="x-list" id="salaryTb">
               <tr>
                  <th width="90">Ngày bắt đầu</th>
				  <th width="90">Ngạch</th>
                  <th width="90">Bậc lương</th>
                  <th width="90">Hệ số chính</th>
                  <th width="90">Hệ số phụ cấp</th>
                  <th >Tính lương</th>
                  <th width="25"></th>
               </tr>
               <?php foreach($salary as $ksa => $vsa): ?>
				<tr>
					<td align="center"><?php _e(show_date(DATE_FORMAT,$vsa['dateup']));?></td>
					<td align="center"><?php _e($vsa['title']);?></td>
					<td align="center"><?php _e($vsa['countb']);?></td>
					<td align="center">
						<?php _e( (((float)$vsa['countb']) - 1)*$vsa['subsalary'] + (float)$vsa['initsalary']  );?>
					</td>
					<td align="center"><?php _e($vsa['plussalary']);?></td>
					<td align="center">
						<?php 
							$p = (((float)$vsa['countb']) - 1)*$vsa['subsalary'] + $vsa['initsalary'] + (float)$vsa['plussalary'];
							$st = $this->get('setting');
							_e( number_format($p*$st['basic_salary']) );
						?>
					</td>
					<td width="25" align="center">
						<a onclick="module_delete('<?php _baseUrl()?>/Personnel/Index/delsalary?ID=<?php _e($vsa['ID']);?>',this.parentNode.parentNode)" class="x-delete"></a>
					</td>
				</tr>
               <?php endforeach;?>
            </table>
			<div style="text-align:left;padding:5px">
				<a onclick="addSalaryRow()"><u><b>[+] Thêm mới</b></u></a>
			</div>
         </div>
		 <?php $train = $this->get('train'); ?>
         <div class="tab">
                <table id="Trainee" width="100%" cellpadding="5" class="x-list" >
               <tr>
                  <th>Từ</th>
                  <th>Đến</th>
                  <th>Nơi đào tạo</th>
                  <th width="160">Hệ đào tạo</th>
                  <th>Xếp loại</th>
                  <th>Ghi chú</th>
                  <th width="90" colspan="2"></th>
               </tr>
               <?php foreach($train as $ktrain => $vtrain):?>
				<tr>
					<td><?php _e(show_date(DATE_FORMAT,$vtrain['train_date_from']));?></td>
					<td><?php _e(show_date(DATE_FORMAT,$vtrain['train_date_to']));?></td>
					<td><?php _e($vtrain['train_at']);?></td>
					<td><?php _e($vtrain['train_level_title']);?></td>
					<td><?php _e($vtrain['train_level_type']);?></td>
					<td><?php _e($vtrain['train_desc']);?></td>
					<td width="25" align="center">
						<a onclick="module_delete('<?php _baseUrl()?>/Personnel/Index/deltrain?ID=<?php _e($vtrain['ID']);?>',this.parentNode.parentNode)" class="x-delete"></a>
					</td>
				</tr>
				<?php endforeach;?>
            </table>
			<div style="text-align:left;padding:5px">
				<a onclick="addTrainee()"><u><b>[+] Thêm mới</b></u></a>
			</div>			
         </div>
         <?php $wa = $this->get('work_active'); ?>
         <div class="tab">
            <table id="workHistories" width="100%" cellpadding="5" class="x-list" >
               <tr>
                  <th>Từ</th>
                  <th>Đến</th>
                  <th>Tên đơn vị</th>
                  <th>Ghi chú</th>
                  <th width="90" colspan="2"></th>
               </tr>
               <?php foreach($wa as $ktrain => $a): ?>
				<tr>
					<td><?php _e(show_date(DATE_FORMAT,$a['work_date_from']));?></td>
					<td><?php _e(show_date(DATE_FORMAT,$a['work_date_to']));?></td>
					<td><?php _e($a['work_company']);?></td>
					<td><?php _e($a['work_wnotes']);?></td>
					<td width="25" align="center">
						<a onclick="module_delete('<?php _baseUrl()?>/Personnel/Index/delactivity?ID=<?php _e($a['ID']);?>',this.parentNode.parentNode)" class="x-delete"></a>
					</td>
				</tr>
				<?php endforeach;?>
            </table>
			<div style="text-align:left;padding:5px">
				<a onclick="addWorkHistory()"><u><b>[+] Thêm mới</b></u></a>
			</div>
         </div>
         <div class="tab">
			<?php $govs = $this->get('govs');?>
            <table style="border: 1px solid #CBCBCD;" width="100%" cellpadding="4" class="x-form">
              <tr>
                  <td width="15%" align="right"><b>Thành phần gia đình</b></td>
                  <td width="30%" >
                     <input class="x-text" type="text" name="family" style="width: 292px;"  value="<?php _e($govs['family']); ?>"/>
                  </td>

                  <td width="15%"  align="right" ><b>Nghề nghiệp khi vào đảng</b></td>
                  <td width="40%" >
                     <input class="x-text" type="text" name="job" style="width: 292px;" value="<?php _e($govs['job']); ?>"/>
                  </td>
               </tr>
                <tr>
                  <td align="right"><b>Công việc chính đang làm</b></td>
                  <td>
                     <input class="x-text" type="text" name="main_work" style="width: 292px;" value="<?php _e($govs['main_work']); ?>"/>
                  </td>

                  <td align="right" ><b>Tại</b></td>
                  <td >
                     <input class="x-text" type="text" name="main_work_at" style="width: 292px;" value="<?php _e($govs['main_work_at']); ?>"/>
                  </td>
               </tr>
             <tr>
                  <td align="right"><b>Ngày vào đảng</b></td>
                  <td>
                     <input  value="<?php _e(show_date(DATE_FORMAT,$govs['date_gov_trial'])); ?>" class="x-text x-date" onclick="date_picker(this,{format: 'd/m/Y' })" type="text" name="date_gov_trial"  />
                     <span style="margin-left: 20px;"><i> ( dd / mm / yyyy )</i></span>
                  </td>

                  <td align="right" ><b>Tại chi bộ</b></td>
                  <td >
                     <input class="x-text" type="text" value="<?php _e($govs['date_gov_trial_at']); ?>" name="date_gov_trial_at" style="width: 292px;"  />
                  </td>
               </tr>

               <tr>
                  <td align="right"><b>Người giới thiệu 1</b></td>
                  <td>
                     <input class="x-text" type="text" name="per_take1" style="width: 292px;" value="<?php _e($govs['per_take1']); ?>"/>
                  </td>
                  <td align="right"><b>Chức vụ , đơn vị</b></td>
                  <td>
                     <input class="x-text" type="text" name="per_take1_at" style="width: 292px;" value="<?php _e($govs['per_take1_at']); ?>"/>
                  </td>
               </tr>
               <tr>
                  <td align="right"><b>Người giới thiệu 2</b></td>
                  <td>
                     <input class="x-text" type="text" name="per_take2" style="width: 292px;" value="<?php _e($govs['per_take2']); ?>"/>
                  </td>
                  <td align="right"><b>Chức vụ , đơn vị</b></td>
                  <td>
                     <input class="x-text" type="text" name="per_take2_at" value="<?php _e($govs['per_take2_at']); ?>" style="width: 292px;" />
                  </td>
               </tr>

               <tr>
                  <td align="right"><b>Ngày chính thức</b></td>
                  <td>
                     <input  class="x-text x-date" onclick="date_picker(this,{format: 'd/m/Y' })" type="text" value="<?php _e(show_date(DATE_FORMAT,$govs['date_gov_reg'])); ?>" name="date_gov_reg" />
                     <span style="margin-left: 20px;"><i> ( dd / mm / yyyy )</i></span>
                  </td>
                  <td align="right"><b>Tại chi bộ</b></td>
                  <td>
                     <input class="x-text" type="text" name="date_gov_reg_at" value="<?php _e($govs['date_gov_reg_at']); ?>" style="width: 292px;" />
                  </td>
               </tr>
                <tr>
                  <td align="right"><b>Ngày tuyển dụng làm cán bộ công chức</b></td>
                  <td>
                    <input  class="x-text x-date" onclick="date_picker(this,{format: 'd/m/Y' })" type="text" value="<?php _e(show_date(DATE_FORMAT,$govs['date_join'])); ?>" name="date_join"  />
                     <span style="margin-left: 20px;"><i> ( dd / mm / yyyy )</i></span>
                  </td>
                  <td align="right"><b>Cơ quan tuyển dụng</b></td>
                  <td>
                     <input class="x-text" type="text" name="unit" style="width: 292px;" value="<?php _e($govs['unit']); ?>"/>
                  </td>
               </tr>
                <tr>
                  <td align="right"><b>Gia đình liệt sỹ</b></td>
                  <td>
                      <input type="hidden" name="fa_lietsy" value="no"/>
                      <input class="x-text" type="checkbox" name="fa_lietsy" value="yes"<?php if($govs['fa_lietsy']=='yes') _e(' checked'); ?>/>
                  </td>
                  <td align="right"><b>Gia đình có công với CM</b></td>
                  <td>
                     <input type="hidden" name="fa_cocong" value="no"/>
                     <input class="x-text" type="checkbox" name="fa_cocong" value="yes"<?php if($govs['fa_cocong']=='yes') _e(' checked'); ?>/>
                  </td>
               </tr>
              </table>
			  
				<table id="workActiveSHD" width="100%" cellpadding="5" class="x-list" >
				   <tr>
					  <th width="100">Từ</th>
					  <th width="100">Đến</th>
					  <th width="200">Tại chi bộ</th>
					  <th>Ghi chú</th>
					  <th width="25" colspan="2"></th>
				   </tr>
					<?php foreach( $this->get('govacts') as $agovact ):?>
					<tr>
						<td align="center">
							<?php _e(show_date(DATE_FORMAT,$agovact['date_govs_from']))?>
						</td>
						<td align="center">
							<?php _e(show_date(DATE_FORMAT,$agovact['date_govs_to']))?>
						</td>
						<td>
							<?php _e($agovact['act_at'])?>
						</td>
						<td>
							<?php _e($agovact['act_desc'])?>
						</td>
						
						<td width="25" align="center">
							<a onclick="module_delete('<?php _baseUrl()?>/Personnel/Index/delgovact?ID=<?php _e($agovact['ID']);?>',this.parentNode.parentNode)" class="x-delete"></a>
						</td>
					</tr>
					<?php endforeach;?>				   
				</table>
				
			 	<div style="text-align:left;padding:5px">
					<a onclick="addSHD()"><u><b>[+] Thêm mới</b></u></a>
				</div>
         </div>
         <div class="tab">
            <table width="100%" style="background-color: #F0F0F0;border: 1px solid #CBCBCD;" cellpadding="4" class="x-form">
               <tr>
                  <td colspan="2" ><b>File hồ sơ kèm theo</b></td>
               </tr>
               <tr>
                  <td style="padding:10px">
                     <?php foreach ($this->get('files') as $file):?>
                        <div class='x-file-info' style="padding:5px 0px">
                           <input checked type='checkbox' name='files[]' value='<?php _e($file['ID']); ?>'/>
                           <a href="<?php _ctrUrl($this); ?>/File?ID=<?php _e($file['ID']); ?>" target="_blank"><?php _e($file['filename']); ?> <?php _e($file['size']); ?> KB	</a>
                        </div>
                     <?php endforeach; ?>

                     <div class="x-files" url="<?php _baseUrl(); ?>/Personnel/Index/Upload?ID=<?php _e(get('ID')) ?>">Đính kèm file</div>
                  </td>
               </tr>
            </table>
         </div>
		 
		<!--CONTRACTS-->
		<div class="tab">
			<table id="tbContract" width="100%" cellpadding="5" class="x-list" >
               <tr>
				  <th width="160">Tên HĐ</th>
				  <th width="160">Mã HĐ</th>
                  <th>Loại HĐ</th>
                  <th>Ngày ký</th>
                  <th>Ngày có hiệu lực</th>
                  <th width="160">Ngày hết hiệu lực</th>
                  <th width="25"></th>
               </tr>
				<?php foreach($this->get('contracts') as $a ){?>
					<tr>
						<td align="center"><?php _e($a['title']);?></td>
						<td align="center"><?php _e($a['code']);?></td>
						<td align="center"><?php _e($a['type']);?></td>
						<td align="center"><?php _e(show_date(DATE_FORMAT,$a['date_reg']));?></td>
						<td align="center"><?php _e(show_date(DATE_FORMAT,$a['date_start']));?></td>
						<td align="center"><?php _e(show_date(DATE_FORMAT,$a['date_finish']));?></td>
						<td align="center" width="25">
							<a onclick="module_delete('<?php _baseUrl();?>/Personnel/Index/delcontract?ID=<?php _e($a['ID'])?>',this.parentNode.parentNode)" class="x-delete"></a>
					</tr>
				<?php }?>
			</table>	
			<div style="text-align:left;padding:5px">
				<a onclick="addContract()"><u><b>[+] Thêm mới</b></u></a>
			</div>			
		</div>		 
		 
         <table style="margin-top: 3px;margin-bottom: 3px;background-color: white;" width="100%" cellpadding="4" >
            <tr>
               <td colspan="4" align="center">
                  <input type="submit" value="Xác nhận" class="x-button x-save"/>
                  <a href="#Personnel" class="x-button x-fresh">Hủy bỏ</a>
               </td>
            </tr>
         </table>
      </div>
   </div>
</form>
